#include <Windows.h>
#include "glew.h"
#include <gl/GL.h>
#include <gl/GLU.h>
#include "glut.h"
#include <stdio.h>
#include "PngDecoder.h"
#include "StencilExample.h"
#include "Example.h"

Example* example;

void init() {
	example = new StencilExample;
	example->init();

	int width, height;
	void* image = PngDecoder::decoder("C:/Users/Administrator/source/repos/OpenGL/Ressource/xiniu.png", width, height);
}

void display() {
	glClearColor(0, 0, 0, 0);

	example->draw();
	glFlush();
	glutSwapBuffers();
}

int main(int argc, char** argv) {
	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
	glutInitWindowSize(400, 400);
	glutInitWindowPosition(200, 200);
	glutCreateWindow("OpenGL");
	if (glewInit()) {
		printf("unable to init glew\n");
	}
	init();
	glutDisplayFunc(display);
	glutMainLoop();

	return 0;
}